function formatTimeForCompare(inDate) {
	var timeHours = inDate.getHours();
	var timeMinutes = inDate.getMinutes();
	
	if (timeHours < 10) {
		timeHours = "0" + timeHours
	}
	
	if (timeMinutes < 10) {
		timeMinutes = "0" + timeMinutes
	}
	
	return timeHours + ":" + timeMinutes;
}

function updateDayTimeModel(timeOpenObj, timeCloseObj) {
	var timeOpenCompare = formatTimeForCompare(timeOpenObj);
	var timeCloseCompare = formatTimeForCompare(timeCloseObj);
	
	if (timeCloseCompare == timeOpenCompare) {
		timeCloseObj.setDate(timeOpenObj.getDate());
	} else if (timeCloseCompare < timeOpenCompare) {
		timeCloseObj.setDate(timeOpenObj.getDate() + 1);
	} else {
		timeCloseObj.setDate(timeOpenObj.getDate());
	}
}

function updateDayInfoText(domObj, timeOpenObj, timeCloseObj) {
	var timeOpenCompare = formatTimeForCompare(timeOpenObj);
	var timeCloseCompare = formatTimeForCompare(timeCloseObj);

	Mojo.Log.info("========================================");
	Mojo.Log.info("timeOpenObj:  " + timeOpenObj);
	Mojo.Log.info("timeOpenMS:   " + timeOpenObj.getTime());
	Mojo.Log.info("----------------------------------------");
	Mojo.Log.info("timeCloseObj: " + timeCloseObj);
	Mojo.Log.info("timeCloseMS:  " + timeCloseObj.getTime());
	Mojo.Log.info("========================================");

	if (timeCloseCompare == timeOpenCompare) {
		domObj.update("Open and close are same");
	} else if (timeCloseCompare < timeOpenCompare) {
		domObj.update("Opens this day, closes the next day");
	} else {
		domObj.update("Opens and closes the same day");
	}
}
